package org.giovanolli.mumi.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * The Class PaymentDetail.
 */
@Entity
@Table(name = "payment_detail")
public class PaymentDetail extends IdentificableEntity {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -2735407512715590010L;

	/** The payment plan. */
	@ManyToOne
	@JoinColumn(name = "payment_id", nullable = false)
	private Payment payment;

	/** The amount. */
	@Column(name = "amount")
	private Double amount;

	/** The date. */
	@Column(name = "date")
	private Date date;

	/** The payment concept. */
	@ManyToOne
	@JoinColumn(name = "payment_concept_id", nullable = false)
	private PaymentConcept paymentConcept;

	/** The observation. */
	@Column(name = "observation")
	private String observation;

	/**
	 * Gets the amount.
	 * 
	 * @return the amount
	 */
	public Double getAmount() {
		return amount;
	}

	/**
	 * Gets the date.
	 * 
	 * @return the date
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * Gets the observation.
	 * 
	 * @return the observation
	 */
	public String getObservation() {
		return observation;
	}

	/**
	 * Gets the payment.
	 * 
	 * @return the payment
	 */
	public Payment getPayment() {
		return payment;
	}

	/**
	 * Gets the payment concept.
	 * 
	 * @return the payment concept
	 */
	public PaymentConcept getPaymentConcept() {
		return paymentConcept;
	}

	/**
	 * Sets the amount.
	 * 
	 * @param amount
	 *            the new amount
	 */
	public void setAmount(Double amount) {
		this.amount = amount;
	}

	/**
	 * Sets the date.
	 * 
	 * @param date
	 *            the new date
	 */
	public void setDate(Date date) {
		this.date = date;
	}

	/**
	 * Sets the observation.
	 * 
	 * @param observation
	 *            the new observation
	 */
	public void setObservation(String observation) {
		this.observation = observation;
	}

	/**
	 * Sets the payment.
	 * 
	 * @param payment
	 *            the new payment
	 */
	public void setPayment(Payment payment) {
		this.payment = payment;
	}

	/**
	 * Sets the payment concept.
	 * 
	 * @param paymentConcept
	 *            the new payment concept
	 */
	public void setPaymentConcept(PaymentConcept paymentConcept) {
		this.paymentConcept = paymentConcept;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.giovanolli.mumi.entities.IdentificableEntity#toString()
	 */
	@Override
	public String toString() {
		return "PaymentDetail [ amount=" + amount + ", date=" + date + ", paymentConcept=" + paymentConcept + "]";
	}

}
